<template>
	<view style="padding:0 24rpx;">
		<view class="tit">
			<image src="@/static/bj/icon_sqsj.png" mode="heightFix"></image>
			<text class="tit-msg">申请三家以上通过率更高</text>
		</view>
	<!-- 	<view class="NoOne">
			<template v-if="list2">
				
				<list2 @goInfo="goInfo" :list="list2"></list2>
			</template>
			<view class="noTj" v-else>
				暂无推荐
			</view>

		</view> -->

		<view class="" >
			<list @goInfo="goInfo" v-if="list.length!=0" :list="list"></list>
			<noData v-else></noData>
		</view>
		
		
		
	</view>
</template>

<script>
	import noData from '@/components/noData/index.vue'
	import {
		getShopListv1,
		clickGood,
		clickShop,
		clickChannel,
		
	} from '@/api/index.js'
	import list2 from '@/pagesC/list/com/components/list2.vue'
	import list from '@/components/list/list.vue'
	export default {
		components: {
			list,
			list2,
			noData
		},
		data() {
			return {
				list2: [],
				list: [],
				pageData: {
					"pageSize": 20,
					"currentPage": 1
				}
			}
		},
		onReachBottom() {
			// this.pageData.currentPage++
			// this.init()
			
		},
		onShow() {
			let data = {
				name: '列表页',
				age: "23"
			}
			this.$ymmd(data)
		},
		onLoad() {
			this.init()
		},
		methods: {
			async init() {
				let res = await getShopListv1(this.pageData)
				// console.log(res.data)
				// res.data.map(ress=>{
				// 	console.log(ress,'我爱你')
				// })
				this.list=res.data
				// this.list2=res.data[0]
				// this.list.splice(0, 1)
				
				// this.list = this.list.concat(res.data)
				// if(this.list2){
				// 	this.list2 = this.list[0]
				// 	console.log("截取")
				// }else{
				// 	this.list.splice(0, 1)
				// 	console.log("n截取")
				// }
				
			},
			async goInfo(item) {
				console.log(item,'item')
				this.$ymmdBtn("ymBtnPro",{
					name:'点击产品带id',
					id:item.id
				})
				this.goPage(item.h5url)
				let datass = {
					shopId: item.id
				}
				let p=await clickChannel(datass)
				return;
				let clickShopData = {
					shopId: item.id,
					type: item.openType
				}
				
				let ress = await clickShop(clickShopData)
				if (item.openType == 0) {
					this.goPage(item.h5url)
					// 连登
				} else if (item.openType == 1) {
					let data = {
						shopId: item.id,
						type: item.openType
					}
					let ll = await clickGood(data)
					if (ll.code == 100000) {
						let datass = {
							shopId: item.id
						}
						let p=await clickChannel(data)

					}
					this.goPage(ll.data.h5url)
				}
			},
	
			goPage(url) {
				// window.location.replace(url)

				uni.navigateTo({
					url: `/pagesB/webview/webview?url=${url}`
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background: #F3F4F5;
	}

	.noTj {
		text-align: center;
		line-height: 320rpx;
		color: #fff;
		
	}

	.tit {
		padding:24rpx 30rpx;
		// height: 40rpx;
		.tit-msg{
			color: #333;
			font-size: 28rpx;
			margin-left: 10rpx;
		}
		image{
			width: 32rpx;
			height: 32rpx;
			vertical-align: middle;
		}
	}

	
	.NoOne {
		// padding: 20rpx;r
		
		box-shadow: 0px 8rpx 29rpx 4rpx #FAC6A3;
		
		// height: 338rpx;
		background-image: url("../../static/bj/icon_list_bj.png");
		background-size: 100% 100%;
		border-radius: 30rpx;
	}
</style>